package com.xuecheng.controller;

import com.xuecheng.service.CoursePublishPreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 课程发布
 */
@Slf4j
@RestController("coursePublishPre")
@Api(value = "课程发布", tags = "课程发布")
public class CoursePublishPreController {
	
	@Resource
	private CoursePublishPreService coursePublishPreService;
	
	/**
	 * 课程审核提交
	 */
	@PostMapping("/courseaudit/commit/{courseId}")
	@ApiOperation("课程审核提交")
	public void commitAudit(@PathVariable Long courseId) {
		Long companyId = 1232141425L;
		log.info("课程审核提交,companyId：{}，课程id：{}", companyId, courseId);
		coursePublishPreService.commitAudit(companyId, courseId);
	}
	
	/**
	 * 课程发布
	 */
	@PostMapping("/coursepublish/{courseId}")
	@ApiOperation("课程发布")
	public void coursepublish(@PathVariable("courseId") Long courseId) {
		Long companyId = 1232141425L;
		log.info("课程发布,companyId：{}，课程id：{}", companyId, courseId);
		coursePublishPreService.publish(companyId, courseId);
	}
}
